home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / uconv / uconvutil.h < prev   
C/C++ Source or Header  |  2006-05-08  |  4KB  |  123 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is Mozilla Communicator client code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *   jeroen.dobbelaere@acunia.com
  24.  *
  25.  * Alternatively, the contents of this file may be used under the terms of
  26.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  27.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28.  * in which case the provisions of the GPL or the LGPL are applicable instead
  29.  * of those above. If you wish to allow use of your version of this file only
  30.  * under the terms of either the GPL or the LGPL, and not to allow others to
  31.  * use your version of this file under the terms of the MPL, indicate your
  32.  * decision by deleting the provisions above and replace them with the notice
  33.  * and other provisions required by the GPL or the LGPL. If you do not delete
  34.  * the provisions above, a recipient may use your version of this file under
  35.  * the terms of any one of the MPL, the GPL or the LGPL.
  36.  *
  37.  * ***** END LICENSE BLOCK ***** */
  38. #ifndef __UCONV_TIL_H__
  39. #define __UCONV_TIL_H__
  40.  
  41. #include "prcpucfg.h"
  42.  
  43.  
  44. /*=====================================*/
  45. #define PACK(h,l)   (int16)(( (h) << 8) | (l))
  46.  
  47. #if defined(IS_LITTLE_ENDIAN)
  48. #define ShiftCell(sub,len,min,max,minh,minl,maxh,maxl)  \
  49.     PACK(len,sub), PACK(max,min), PACK(minl,minh), PACK(maxl,maxh)
  50. #else
  51. #define ShiftCell(sub,len,min,max,minh,minl,maxh,maxl)  \
  52.     PACK(sub,len), PACK(min, max), PACK(minh,minl), PACK(maxh,maxl)
  53. #endif
  54.  
  55. typedef enum {
  56.         u1ByteCharset = 0,
  57.         u2BytesCharset,
  58.         uMultibytesCharset,
  59.         u2BytesGRCharset,
  60.         u2BytesGRPrefix8FCharset,
  61.         u2BytesGRPrefix8EA2Charset,
  62.         u2BytesSwapCharset,
  63.         u4BytesCharset,
  64.         u4BytesSwapCharset,
  65.         u2BytesGRPrefix8EA3Charset,
  66.         u2BytesGRPrefix8EA4Charset,
  67.         u2BytesGRPrefix8EA5Charset,
  68.         u2BytesGRPrefix8EA6Charset,
  69.         u2BytesGRPrefix8EA7Charset,
  70.         u1ByteGLCharset,
  71.         uDecomposedHangulCharset,
  72.         uJohabHangulCharset,
  73.         uJohabSymbolCharset,
  74.         u4BytesGB18030Charset,
  75.         u2BytesGR128Charset,
  76.         uNumOfCharsetType
  77. } uScanClassID;
  78.  
  79. typedef enum {
  80.         u1ByteChar                      = 0,
  81.         u2BytesChar,
  82.         u2BytesGRChar,
  83.         u1BytePrefix8EChar,             /* Used by JIS0201 GR in EUC_JP */
  84.         u2BytesUTF8,                    /* Used by UTF8 */
  85.         u3BytesUTF8,                    /* Used by UTF8 */
  86.         uNumOfCharType
  87. } uScanSubClassID;
  88.  
  89. typedef struct  {
  90.         unsigned char   classID;
  91.         unsigned char   reserveLen;
  92.         unsigned char   shiftin_Min;
  93.         unsigned char   shiftin_Max;
  94.         unsigned char   shiftout_MinHB;
  95.         unsigned char   shiftout_MinLB;
  96.         unsigned char   shiftout_MaxHB;
  97.         unsigned char   shiftout_MaxLB;
  98. } uShiftCell;
  99.  
  100. typedef struct  {
  101.         PRInt16         numOfItem;
  102.         PRInt16         classID; 
  103.         uShiftCell      shiftcell[1];
  104. } uShiftTableMutable;
  105.  
  106. typedef const uShiftTableMutable uShiftTable;
  107.  
  108.  
  109. /*=====================================*/
  110.  
  111. typedef struct {
  112.         unsigned char min;
  113.         unsigned char max;
  114. } uRange;
  115.  
  116. /*=====================================*/
  117.  
  118. typedef PRUint16* uMappingTableMutable; 
  119. typedef const PRUint16* uMappingTable; 
  120.  
  121. #endif
  122.  
  123.